package com.bw.greendao.entity;

import android.os.Parcel;
import android.os.Parcelable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

/**
 * @author KK
 * @description:
 * @date :2021/10/20 9:52
 */
@Entity
public class UserEntity implements Parcelable {

    @Id(autoincrement = true)
    private Long id;
    private int user_id;
    private String user_name;
    private String user_pwd;
    private boolean flag = false;
    @Generated(hash = 63781924)
    public UserEntity(Long id, int user_id, String user_name, String user_pwd,
            boolean flag) {
        this.id = id;
        this.user_id = user_id;
        this.user_name = user_name;
        this.user_pwd = user_pwd;
        this.flag = flag;
    }
    @Generated(hash = 1433178141)
    public UserEntity() {
    }

    protected UserEntity(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readLong();
        }
        user_id = in.readInt();
        user_name = in.readString();
        user_pwd = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(id);
        }
        dest.writeInt(user_id);
        dest.writeString(user_name);
        dest.writeString(user_pwd);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<UserEntity> CREATOR = new Creator<UserEntity>() {
        @Override
        public UserEntity createFromParcel(Parcel in) {
            return new UserEntity(in);
        }

        @Override
        public UserEntity[] newArray(int size) {
            return new UserEntity[size];
        }
    };

    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public int getUser_id() {
        return this.user_id;
    }
    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }
    public String getUser_name() {
        return this.user_name;
    }
    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }
    public String getUser_pwd() {
        return this.user_pwd;
    }
    public void setUser_pwd(String user_pwd) {
        this.user_pwd = user_pwd;
    }
    public boolean getFlag() {
        return this.flag;
    }
    public void setFlag(boolean flag) {
        this.flag = flag;
    }

}
